package com.light.gulimall.order.feign;

import com.light.common.utils.R;
import com.light.common.vo.WareStockVO;
import com.light.gulimall.order.vo.FareVo;
import com.light.gulimall.order.vo.StockLockVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 远程调用ware模块
 */
@FeignClient(name = "gulimall-ware")
public interface WareRemoteServiceClient {

    @RequestMapping("/ware/waresku/queryWareStock")
    List<WareStockVO> queryWareStock(@RequestBody List<Long> skuIds);


    /**
     * 根据地址id查询运费
     * @param addrId
     * @return
     */
    @GetMapping("/ware/wareinfo/fare")
    FareVo getFare(@RequestParam("addrId") Long addrId);

    /**
     * 锁定库存
     * @param vo
     * @return
     */
    @PostMapping("/ware/wareinfo/order/stockNum")
    R stockLock(@RequestBody StockLockVO vo);
}
